feat: add comprehensive pressure unit conversion#1010
Merged
siriak merged 3 commits intoTheAlgorithms:masterfrom Jan 31, 2026
Merged
feat: add comprehensive pressure unit conversion#1010siriak merged 3 commits intoTheAlgorithms:masterfrom
siriak merged 3 commits intoTheAlgorithms:masterfrom
Conversation
Contributor
Author
|
@siriak, this is ready to be merged. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1010 +/- ##
==========================================
+ Coverage 96.02% 96.05% +0.02%
==========================================
Files 377 378 +1
Lines 27217 27445 +228
==========================================
+ Hits 26135 26362 +227
- Misses 1082 1083 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
siriak
approved these changes
Jan 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a comprehensive pressure unit conversion implementation to the conversions module, supporting 25 different pressure units across multiple measurement systems.
The implementation provides a flexible API that accepts both type-safe enums and convenient string identifiers, making it suitable for various use cases from scientific computing to user-facing applications.
Changes
src/conversions/pressure.rswith conversion support for 25 pressure unitssrc/conversions/mod.rsto include the new module and exportsSupported Pressure Units
SI Units (Pascal-based)
Atmosphere Units
Torr Units
Bar Units
Imperial Units
Other Metric Units
Manometric Units
Features
Flexible API
The
convert_pressure()function accepts both enums and strings:Accurate Conversions
Comprehensive Testing
Single test function covering:
Testing
All tests pass:
cargo test pressureImplementation Details
IntoPressureUnit) to accept both enums and stringsReferences
Checklist
cargo fmt